#include <string>
#include <vector>
#include <ostream>

ostream debugstream = cerr;

#include "link.h"
#include "message.h"

namespace ideayay {
    class base {
    public:
        string path; //Where the item is stored in the tree
        string name;
        string author;
        vector<link*> links;
        vector<message*> messages; //Tree of comments/replies
        float rating;
        time_t timestamp; // Modification date from 1970, time() time.
        bool modified;

        base() :
        modified(true) {
            if(debug)
              debugstream << "Create base object!" << endl;
        }

        //! File operations
        const string &getPath();
        bool setPath(string &dest);

        const string &getName();
        bool setName(string &to);

        float getRating();
        bool setRating(float rating);

        bool setTimestamp(time_t time);
        bool setAuthor(string &who);

        //! Messages
        bool addMessage(message &ref);
        bool removeMessage(message &ref);
        bool removeMessages(vector<message*>::iterator begin, vector<message*>::iterator end);

        //! Links
        //! Same comment as @ Messages
        bool addLink(link &ref);
        bool removeLink(link &ref);
        bool removeLinks();
        vector<link*> *getLinks();
    };
}
